<jsp:include page="header.jsp" flush="true"/>


<%
	//Utilisateur user = new Utilisateur();
	//user.setNom_u("Jean");

	
	
%>

    <!-- Main jumbotron for a primary marketing message or call to action -->
    <div class="jumbotron">
      <div class="container" >
      	<div class="row">
      	<div class="col-md-4">
      		<img src="" alt="votre image">
      		<br/>
      		<br/>
      		<p class="pp_alignleft">(user.getNom_u)</p>
      	</div>
      	<div class="col-md-8">
          <form class="jumbotron-form jumbotron-right" role="form">
            <div class="form-group">
              <input type="password" placeholder="Piou piou quelque chose" class="form-control">
            </div>
            <button type="submit" class="btn btn-default">Go</button>
          </form>
          </div>
		</div>
      </div>
    </div>



	<div class="container">
		<div class="row">

			<!-- column gauche -->
			<div class="col-md-3">
	        	<form class="form" role="form" method="post">
            		<div class="form-group">
              			<input type="password" placeholder="Recherche" class="form-control">
            		</div>
            		<button type="submit" class="btn btn-default">Go</button>
          		</form>
			</div>
			<div class="col-md-1"></div>

			<!-- column droit -->
			<div class="col-md-8">
				<div id="loadPosts">
		    	<% 
		    	
	    		
		    	for(int i=0;i<30;i++){
						out.println("<h4>" + "(post.auteur_t)" + "</h4>");
						out.println("<h6>" + "(post.date_t)" + "</h6>");
						out.println("<p>" + "(post.texte_t)" + "</p>");
						out.println("<p><a class='btn btn-primary btn-xs' href='#' role='button'>Re-Piouter</a></p>");
						out.println("<br/>");
		    	}
		    	
				%>
				</div>
				<h4 id="loadPlusIci"><a onclick="loadPlusDePosts()">Cliquer pour plus de posts</a></h4>
			</div>
		</div>
	</div>

<script>
var seconds = 5;
loadPosts(seconds);

function loadPosts()
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("loadPosts").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","listeDesPostes.jsp",true);
xmlhttp.send();
onsuccess: setTimeout(function(){loadPosts(5);}, seconds*1000)
}



function loadPlusDePosts()
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("loadPlusIci").outerHTML=xmlhttp.responseText + '<h4 id="loadPlusIci"><a onclick="loadPlusDePosts()">Cliquer pour plus de posts</a></h4>';
    }
  }
xmlhttp.open("GET","listeDesPostes.jsp",true);
xmlhttp.send();
}
</script>


<jsp:include page="footer.jsp" flush="true"/>